﻿
Partial Class Public_Download
    Inherits System.Web.UI.Page

    Protected Sub gv_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gv.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim hlinkValue As HyperLink = e.Row.FindControl("hlinkValue")
            Dim FilePath As String = ""
            If hlinkValue IsNot Nothing Then
                '編輯
                hlinkValue.Text &= ".doc"
                FilePath = Server.MapPath(System.Web.Configuration.WebConfigurationManager.AppSettings("DescriptionPath")) & hlinkValue.Text

                If System.IO.File.Exists(FilePath) Then
                    hlinkValue.NavigateUrl = Me.ResolveUrl(System.Web.Configuration.WebConfigurationManager.AppSettings("DescriptionPath")) & hlinkValue.Text
                Else
                    hlinkValue.Enabled = False
                End If
            End If
        End If
    End Sub
End Class
